<template>
    <div class="register">
        <ul class="clr">
            <li>
                <input type="text" v-model="username" placeholder="请输入用户名" />
            </li>
            <li>
                <input type="password" v-model="password" placeholder="请输入密码" />
            </li>
            <li>
                <input type="password" v-model="repassword" placeholder="请输入确认密码" />
            </li>
            <li>
                <button @click="apiRegister">注册</button>
            </li>
        </ul>
    </div>
</template>

<script>
    export default {
        name: "Register",
        data () {
            return {
                username:'',
                password:'',
                repassword:''
            }
        },
        methods: {
            apiRegister () {
                this.$http.post('/api/register',{
                    username: this.username,
                    password: this.password,
                    repassword: this.repassword
                }).then( rs => {
                    let datas = rs.data;
                    console.log(datas)
                    // if(datas.code == 0){
                    // }
                })
            }
        }
    }
</script>

<style lang="less" scoped>

</style>